from PIL import Image
import os

im = Image.open('./图片合成/img/侧脸高清美女张婧仪电脑壁纸.jpg')
w, h = im.size
image_row = 2
image_column = 8
names = os.listdir('./图片合成/img')
# 创建画布
new_img = Image.new('RGB', (image_column * w, image_row * h))
for y in range(image_row):
    for x in range(image_column):
        o_img = Image.open('./图片合成/img/' + names[image_column * y + x])
        new_img.paste(o_img, (x * w, y * h))
new_img.save('new_img.jpg')
